package com.example.review;


import java.io.*;

public class Test7 {
    public static void main(String[] args) throws IOException {
        File file = new File("src.txt");
        File file1 = new File("desc.txt");
        FileReader fileReader =null;
        FileWriter fileWriter = null;
        BufferedReader bufferedReader =null;
        BufferedWriter bufferedWriter = null;
        try {
            fileReader = new FileReader(file);
            fileWriter = new FileWriter(file1);
            bufferedReader = new BufferedReader(fileReader);
            bufferedWriter = new BufferedWriter(fileWriter);
            String str;
            while ((str = bufferedReader.readLine() )!= null){
                System.out.println(str);
                bufferedWriter.write(str);
                bufferedWriter.newLine();
            }


        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            bufferedReader.close();
            bufferedWriter.close();
            fileReader.close();
            fileWriter.close();
        }
    }
}
